package com.hanrui.android.widget.bottomnavigationbar;

import android.content.Context;
import android.util.AttributeSet;

import com.ashokvarma.bottomnavigation.BottomNavigationBar;
import com.ashokvarma.bottomnavigation.BottomNavigationItem;
import com.hanrui.android.R;

/**
 * Created by Administrator on 2018/3/9.
 */

public class BottomApprovalBar extends BottomNavigationBar {

    public BottomApprovalBar(Context context) {
        this(context, null);
    }

    public BottomApprovalBar(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public BottomApprovalBar(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    BottomNavigationItem messageItem;
    BottomNavigationItem workItem;
    BottomNavigationItem mobileItem;

    private void init(){


            messageItem = new BottomNavigationItem(R.mipmap.bottom_files_select,"基本信息")
                    .setInactiveIconResource(R.mipmap.bottom_files_unselect)
                    .setActiveColorResource(R.color.c_2795ff)
                    .setInActiveColorResource(R.color.c_666666);

            workItem = new BottomNavigationItem(R.mipmap.bottom_lc_select,"流程图")
                    .setInactiveIconResource(R.mipmap.bottom_lc_unselect)
                    .setActiveColorResource(R.color.c_2795ff)
                    .setInActiveColorResource(R.color.c_666666);

            mobileItem = new BottomNavigationItem(R.mipmap.bottom_exam_select,"流程审批")
                    .setInactiveIconResource(R.mipmap.bottom_exam_unselect)
                    .setActiveColorResource(R.color.c_2795ff)
                    .setInActiveColorResource(R.color.c_666666);

            //设置底部导航模式及样式
            setMode(BottomNavigationBar.MODE_FIXED);
            setBackgroundStyle(BottomNavigationBar.BACKGROUND_STYLE_STATIC);
            setBarBackgroundColor(R.color.white);
            addItem(messageItem).addItem(workItem).addItem(mobileItem).setFirstSelectedPosition(0).initialise();


    }

}
